<template>
  <div class="global-common-page-template-container">
    <common-header :title="title" v-if="title || $slots.header">
      <slot name="tabs" slot="tabs"></slot>
      <slot name="header" slot="default"></slot>
    </common-header>

    <div class="common-search-container" v-if="$slots.search">
      <slot name="search"></slot>
    </div>

    <div class="common-tools-container" v-if="$slots.tools">
      <slot name="tools"></slot>
    </div>

    <div class="common-content-container" v-if="$slots.content">
      <slot name="content"></slot>
    </div>

    <div class="page-pagination" v-if="$slots.pagination">
      <slot name="pagination"></slot>
    </div>

    <slot></slot>
  </div>
</template>

<script>
export default {
  name: "CommonPage",
  props: {
    title: {
      type: String,
      default: "",
    },
  },
  data() {
    return {};
  },
};
</script>

<style scoped lang="scss">
.global-common-page-template-container {
  position: absolute;
  background-color: #fff;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  z-index: 1099;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;

  .common-search-container {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 18px 18px 0 18px;
  }

  .common-tools-container {
    padding-bottom: 18px;
    z-index: 1;
    background: #fff;
    padding: 0 18px;
  }

  .common-content-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    z-index: 990;
    padding: 18px 18px 0 18px;
  }
  .page-pagination {
    padding: 0 18px 18px 18px;
  }
}
</style>
